#include <bits/stdc++.h>
using namespace std;

typedef struct student {
	char name[10];
	int chinese;
	int math;
	int english;
	int sum = 0;
} Stu;

Stu stu[1000] = {0};

int main() {
	int num = 0;
	int _maxindex = 1;
	cin >> num;
	for (int i = 1; i <= num; ++i) {
		cin >> stu[i].name >> stu[i].chinese >> stu[i].math >> stu[i].english;
		stu[i].sum = stu[i].chinese + stu[i].math + stu[i].english;
		if (stu[i].sum > stu[_maxindex].sum) {
			_maxindex = i;
		}
	}
	printf("%s %d %d %d", stu[_maxindex].name, stu[_maxindex].chinese,
	       stu[_maxindex].math, stu[_maxindex].english);
	return 0;
}